﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TaiwuModFramework.Common.Info {

    [Serializable]
    public class RespInfo {


        public enum Code : ushort {
            Success = 01,
            Failed = 00,
            Error = 99
        }

        public Code code;
        public object data;

        public static RespInfo Success(object data) {
            return new RespInfo() {
                code = Code.Success,
                data = data
            };
        }

        public static RespInfo Error(string msg) {
            return new RespInfo() {
                code = Code.Error,
                data = msg
            };
        }
    }
}
